<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8"/>
    <title>添加</title>
    <link href="__STATIC__/component/pear/css/pear.css" rel="stylesheet"/>
</head>
<body class="childrenBody {:dialog_css()}">

<form class="layui-form" action="{:url('add')}" method="post">

    <div class="layui-form-item">
	<label class="layui-form-label layui-form-item-required">昵称</label>
	<div class="layui-input-block"><input type="text" name="nickname" value=""  lay-verify="required" placeholder="请输入昵称" class="layui-input"/></div>
</div>

<div class="layui-form-item">
	<label class="layui-form-label layui-form-item-required">邮箱</label>
	<div class="layui-input-block"><input type="text" name="email" value=""  lay-verify="required" placeholder="请输入邮箱" class="layui-input"/></div>
</div>

<div class="layui-form-item">
	<label class="layui-form-label layui-form-item-required">留言</label>
	<div class="layui-input-block"><textarea name="msg" id="editor-msg" lay-verify="required" placeholder="请输入留言" class="layui-textarea"></textarea></div>
</div>


    <div class="layui-form-item layer-footer">
        <div class="layui-input-block">
            <button type="submit" class="layui-btn layui-btn-normal layui-btn-sm" lay-submit="" lay-filter="save">
                <i class="layui-icon layui-icon-ok"></i>
                添加
            </button>
            <button type="reset" class="layui-btn layui-btn-primary layui-btn-sm">
                <i class="layui-icon layui-icon-refresh"></i>
                重置
            </button>
        </div>
    </div>
</form>

<script src="__STATIC__/component/layui/layui.js"></script>
<script src="__STATIC__/component/pear/pear.js"></script>
<script>
    layui.use(['aphpForm', 'aphp', 'form'], function () {
        var aphpForm = layui.aphpForm,
            aphp = layui.aphp,
            form = layui.form;

        aphpForm.bindEvent('form.layui-form');

        form.on('submit(save)', function (data) {
            aphp.request.postForm(data, 0, function () {
                parent.layer.close(parent.layer.getFrameIndex(window.name));
                parent.layui.table.reload('currentTable');
            });
            return false;
        });
    })
</script>
</body>
</html>